/**
 * Created by senlin.gu on 18/08/07
 * 用于调用后台接口服务
 */
import httpFetch from "share/httpFetch";
import config from "config";

export default {
  //获取function Profile配置文件
  getPersonalFunctionProfile: function (type) {
    if (type === 'group') {
      return httpFetch.get(config.baseUrl + '/api/function/profiles?roleType=TENANT');
    } else if (type === 'company') {
      return httpFetch.get(config.baseUrl + '/api/function/profiles/company');
    } else if (type === 'user') {
      return httpFetch.get(config.baseUrl + '/api/function/profiles');
    }
  },
  savePersonalFunctionProfile: function (profile, type) {
    if (type === 'group') {
      return httpFetch.post(
        config.baseUrl + '/api/function/profiles?roleType=TENANT',
        profile);
    } else {
      return httpFetch.post(
        config.baseUrl + '/api/function/profiles',
        profile);
    }
  }
}
